import 'package:flutter_yn_goods/base/controller/base_list_more_controller.dart';

// import 'package:flutter_yn_goods/pages/completed_orders/model/model_completed_order.dart';
import 'package:flutter_yn_goods/pages/order/order_add/model/model_order_list.dart';
import 'package:flutter_yn_goods/user/app_user_manager.dart';
import 'package:flutter_yn_goods/utils/http/http_export.dart';
import 'package:get/get.dart';

class CompletedOrdersLogic extends BaseListMoreController {
  static const String tag = 'CompletedOrdersLogic';

  @override
  void onInit() {
    super.onInit();
  }

  @override
  Future<List> loadData() async {
    HttpResponse response = await HttpManager().get(
      API.getOrderList,
      params: {
        'page': pageNum,
        'limit': pageSize,
        'status': 2,
      },
    );
    return (response.data['list'] as List)
        .map((e) => ModelOrderList.fromJson(e))
        .toList();
  }

  // 跳转到订单详情页面
  void goToOrderDetail(int orderId) {
    // 根据实际情况修改跳转逻辑
    // Get.toNamed(AppRoutes.orderDetailPage, arguments: {'id': orderId});
  }
}
